1. Technical Field
The present disclosure relates to a memory controller and a memory device, and more particularly, to a memory controller providing high security performance and a memory device including the memory controller.
2. Discussion of Related Art
Security and protection of stored data in a memory device are of great importance. For example, it is desirable to prevent unauthorized people from accessing, leaking, or falsifying stored data. Boot data used to execute a program may be stored in an external memory. A central processing unit (CPU) may read the boot data from the external memory by using a memory controller and execute a program corresponding to the stored boot data. However, if the boot data is falsified before it is used, the security of a system can be compromised.
FIG. 1 illustrates a conventional memory device 100 that includes a security function. Referring to FIG. 1, the memory device 100 includes a CPU 120, a memory controller 110, and an external memory 130. The external memory 130 stores a boot code. The external memory 130 is disposed separately from the CPU 120 and the memory controller 110.
The CPU 120 makes a request to the memory controller 110 for the boot code stored in the external memory 130. The CPU 120 boots a specific processor or program by using the boot code received in response to the request. The external memory 130 includes a data storage unit 132 and an encryption unit 134. The data storage unit 132 stores the above-described boot code. Data stored in the data storage unit 132 is not encrypted. The encryption unit 134 encrypts the boot code stored in the data storage unit 132.
When the CPU 120 requests the boot code, the external memory 130 outputs the encrypted boot code to the memory controller 110. An internal ROM 112 of the memory controller 110 decrypts the encrypted boot code output by the external memory 130 and outputs the decrypted boot code to an external RAM 140.
The internal ROM 112 checks whether encrypted boot data or an encrypted boot code has been falsified. The internal ROM 112 stores its own encryption values (hereinafter, referred to as “self-stored encryption values”). When the internal ROM 112 receives encrypted data from the external memory 130, it searches for a self-stored encryption value corresponding to the received encrypted data. When the internal ROM 112 finds the self-stored encryption value, it compares the encrypted value received from the external memory 130 with the found self-stored encryption value.
If the encrypted value received from the external memory 130 is identical to the found self-stored encryption value, the internal ROM 112 determines that the boot data or boot code stored in the data storage unit 132 of the external memory 130 is authentic. However, if the encrypted value received from the external memory 130 is not identical to the found self-stored encryption value, the internal ROM 112 determines that the boot data or boot code stored in the data storage unit 132 of the external memory 130 has been falsified. The internal ROM 112 only determines whether the boot data or boot code stored in the data storage unit 132 of the external memory 130 has been falsified, and does not encrypt the data stored in the data storage unit 132.
After the internal ROM 112 determines that the boot data or boot code stored in the data storage unit 132 is authentic, the CPU 120 initiates a booting operation by using the boot code stored in the external memory 130. The CPU 120 decrypts the encrypted boot data or boot code received from the external memory 130. Then, the CPU 120 transmits the decrypted boot code to an external RAM 140. The CPU 120 randomly accesses the external RAM 140 and reads decrypted data or a program code from the external RAM 140. The CPU 120 performs a specific program by using the read-out data.
Data output by the external RAM 140 is decrypted data, and thus unencrypted data is directly output. Accordingly, ill-intentioned users may extract data from the external RAM 140 and falsify the extracted data. The ill-intentioned users denote people who try to maliciously falsify boot data or a boot code, namely, users who are not allowed to access data.
The external memory 130 is exposed to the outside, and stores unencrypted user data or program codes in the data storage unit 132. Thus, ill-intentioned users may easily access the externally-exposed external memory 130 and falsify the user data or program codes stored in the external memory 130.
When boot data or a boot code needs to be changed due to a change of a processor, encryption values stored in the internal ROM 112 need to be changed. Thus, when a processor change occurs, the internal ROM 112 needs to be replaced.
Thus, there is a need for a memory device that can adaptively protect boot data or a boot code that does not require replacement of an internal ROM.